﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System.Data.SugarClient
{

	#region Abstracts

	internal interface ISugarSoapAction
	{
		ISugarSoapActionResult Execute();
	}

	internal interface ISugarSoapActionResult
	{
		ISugarSoapAction Action { get; }
		bool Success { get; }
	}

	internal interface ISugarSoapSessionAction
	{
		string Session { get; }
	}

	internal interface ISugarSoapSessionActionResult : ISugarSoapActionResult
	{
		new ISugarSoapSessionAction Action { get; }
	}

	internal interface ISugarSoapModuleAction : ISugarSoapSessionAction
	{
		string Module { get; }
	}

	internal interface ISugarSoapModuleActionResult : ISugarSoapSessionActionResult
	{
		new ISugarSoapModuleAction Action { get; }
	}

	#endregion

	internal interface IGetEntryActionResult : ISugarSoapModuleActionResult
	{
		#region Propreties

		object this[int ordinal] { get; }
		int FieldCount { get; }

		#endregion

		#region Methods

		string GetFieldNameAt(int index);

		#endregion
	}

	internal interface IGetEntryListActionResult : ISugarSoapModuleActionResult
	{

		#region Propreties

		object this[int row, int col] { get; }
		int Count { get; }
		int FieldCount { get; }

		#endregion

		SugarVarDef GetVarDefAt(int index);
		string GetFieldNameAt(int index);
		int IndexOf(string field);
		ISugarSoapAction NextPageAction();

	}

	internal interface IGetAvailableModulesActionResult : ISugarSoapSessionActionResult
	{
		string[] AvailableModules { get; }
	}

	internal interface IGetModuleFieldsActionResult : ISugarSoapModuleActionResult
	{
		IList<SugarVarDef> VarDefs { get; }
	}

	internal interface IGetUserIdActionResult : ISugarSoapSessionActionResult
	{
		string Id { get; }
	}

	internal interface ISetEntryActionResult : ISugarSoapModuleActionResult
	{
		string Id { get; }
	}

}
